﻿<nz-card [nzBordered]="false">
  <form nz-form (ngSubmit)="list()" [nzLayout]="'inline'">
    <div nz-row [nzGutter]="24" [class.text-right]="'true'">
      <div nz-col [nzSpan]="24" class="mb-md" [class.text-right]="'true'">
        <button nz-button type="button" (click)="create()" [nzType]="'primary'" [nzSize]="'large'">
          <i class="anticon anticon-plus"></i>
          <span>新建</span>
        </button>
      </div>
    </div>
  </form>
  <nz-table #expandTable  [nzData]="dataSet">
    <thead>
      <tr>
        <th nzWidth="40%">名称</th>
        <th >修改时间</th>
        <th >修改人员</th>
        <th nzWidth="150px">操作</th>
      </tr>
    </thead>
    <tbody>
      <ng-container *ngFor="let data of expandTable.data">
          <ng-container *ngFor="let item of mapOfExpandedData[data.id]">
           <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
              <td
                [nzIndentSize]="item.level * 20"
                [nzShowExpand]="!!item.children"
                [(nzExpand)]="item.expand"
                (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)"> {{item.name}} </td>
              <td>{{item.updatedTime}} </td>
              <td>{{item.updatorName}} </td>
              <td>
                <a href="javascript:void(0);"  (click)="edit(item)">编辑</a>
                  <nz-divider nzType="vertical"></nz-divider>
                  <a href="javascript:void(0);"  (click)="delete(item)">删除</a>
              </td>
            </tr>
        </ng-container>
      </ng-container>            
    </tbody>
  </nz-table>
</nz-card>
<create-category-modal #createCategoryModal (modalSave)="list()"></create-category-modal>
<edit-category-modal #editCategoryModal (modalSave)="list()"></edit-category-modal>

